<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GrPPI: grppi::worker_pool Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.svg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GrPPI
   &#160;<span id="projectnumber">0.3.1</span>
   </div>
   <div id="projectbrief">Generic and Reusable Parallel Pattern Interface</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacegrppi.html">grppi</a></li><li class="navelem"><a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classgrppi_1_1worker__pool-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">grppi::worker_pool Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Pool of worker threads. This class offers a simple pool of worker threads.  
 <a href="classgrppi_1_1worker__pool.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="worker__pool_8h_source.html">worker_pool.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac3ebceb29ce8143d5a8741a029657e72"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#ac3ebceb29ce8143d5a8741a029657e72">worker_pool</a> (int num_threads) noexcept</td></tr>
<tr class="memdesc:ac3ebceb29ce8143d5a8741a029657e72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a worker pool with a number of threads.  <a href="#ac3ebceb29ce8143d5a8741a029657e72">More...</a><br /></td></tr>
<tr class="separator:ac3ebceb29ce8143d5a8741a029657e72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92f880356d613af8d0270934a4cbaa33"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#a92f880356d613af8d0270934a4cbaa33">~worker_pool</a> () noexcept</td></tr>
<tr class="memdesc:a92f880356d613af8d0270934a4cbaa33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructs the worker pool after joining with all threads in the pool.  <a href="#a92f880356d613af8d0270934a4cbaa33">More...</a><br /></td></tr>
<tr class="separator:a92f880356d613af8d0270934a4cbaa33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b1e1870589dc3474ccda45e2e9e1760"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#a4b1e1870589dc3474ccda45e2e9e1760">worker_pool</a> (<a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a> &amp;&amp;) noexcept=default</td></tr>
<tr class="separator:a4b1e1870589dc3474ccda45e2e9e1760"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc5a6f1d2762e5889d2abcdcb8aaf271"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#afc5a6f1d2762e5889d2abcdcb8aaf271">operator=</a> (<a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a> &amp;&amp;) noexcept=default</td></tr>
<tr class="separator:afc5a6f1d2762e5889d2abcdcb8aaf271"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7d75e2868bd64d6626731b787cc1abf"><td class="memTemplParams" colspan="2">template&lt;typename E , typename F , typename... Args&gt; </td></tr>
<tr class="memitem:ad7d75e2868bd64d6626731b787cc1abf"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#ad7d75e2868bd64d6626731b787cc1abf">launch</a> (const E &amp;ex, F f, Args &amp;&amp;...args)</td></tr>
<tr class="memdesc:ad7d75e2868bd64d6626731b787cc1abf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Launch a function in the pool.  <a href="#ad7d75e2868bd64d6626731b787cc1abf">More...</a><br /></td></tr>
<tr class="separator:ad7d75e2868bd64d6626731b787cc1abf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04e01c4ec5458a040d6d4e1423b09517"><td class="memTemplParams" colspan="2">template&lt;typename E , typename F , typename... Args&gt; </td></tr>
<tr class="memitem:a04e01c4ec5458a040d6d4e1423b09517"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#a04e01c4ec5458a040d6d4e1423b09517">launch_tasks</a> (const E &amp;ex, F &amp;&amp;f, Args &amp;&amp;...args)</td></tr>
<tr class="separator:a04e01c4ec5458a040d6d4e1423b09517"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afcc57d84e91af6655791c5b013d21d86"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1worker__pool.html#afcc57d84e91af6655791c5b013d21d86">wait</a> () noexcept</td></tr>
<tr class="memdesc:afcc57d84e91af6655791c5b013d21d86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until all launched tasks have been completed.  <a href="#afcc57d84e91af6655791c5b013d21d86">More...</a><br /></td></tr>
<tr class="separator:afcc57d84e91af6655791c5b013d21d86"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Pool of worker threads. This class offers a simple pool of worker threads. </p>
<dl class="section note"><dt>Note</dt><dd>Current version does not support more threads than the initially set number of threads. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac3ebceb29ce8143d5a8741a029657e72"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">grppi::worker_pool::worker_pool </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_threads</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates a worker pool with a number of threads. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">num_threads</td><td>Number of threads for the pool. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a92f880356d613af8d0270934a4cbaa33"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">grppi::worker_pool::~worker_pool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructs the worker pool after joining with all threads in the pool. </p>

</div>
</div>
<a class="anchor" id="a4b1e1870589dc3474ccda45e2e9e1760"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">grppi::worker_pool::worker_pool </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a> &amp;&amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad7d75e2868bd64d6626731b787cc1abf"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename E , typename F , typename... Args&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void grppi::worker_pool::launch </td>
          <td>(</td>
          <td class="paramtype">const E &amp;&#160;</td>
          <td class="paramname"><em>ex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">F&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Args &amp;&amp;...&#160;</td>
          <td class="paramname"><em>args</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Launch a function in the pool. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">E</td><td>Execution policy type. </td></tr>
    <tr><td class="paramname">F</td><td>Type for launched function. </td></tr>
    <tr><td class="paramname">Args</td><td>Type for launched function arguments. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ex</td><td>Execution policy. </td></tr>
    <tr><td class="paramname">f</td><td>Function to be launched. </td></tr>
    <tr><td class="paramname">args</td><td>Arguments for launched function. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a04e01c4ec5458a040d6d4e1423b09517"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename E , typename F , typename... Args&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void grppi::worker_pool::launch_tasks </td>
          <td>(</td>
          <td class="paramtype">const E &amp;&#160;</td>
          <td class="paramname"><em>ex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">F &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Args &amp;&amp;...&#160;</td>
          <td class="paramname"><em>args</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="afc5a6f1d2762e5889d2abcdcb8aaf271"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a>&amp; grppi::worker_pool::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classgrppi_1_1worker__pool.html">worker_pool</a> &amp;&amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="afcc57d84e91af6655791c5b013d21d86"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void grppi::worker_pool::wait </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wait until all launched tasks have been completed. </p>
<dl class="section post"><dt>Postcondition</dt><dd>Number of workers is 0. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="worker__pool_8h_source.html">worker_pool.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
